Ext.define('Admin.view.news.News', {
    extend: 'Admin.ux.PageGrid',
    xtype: 'news-view',
    title: '新闻管理',
    viewModel: {
        stores: {
            data: {
                type: 'news-store',
                autoLoad: true
            }
        }
    },

    controller:'news',

    columns: [
        { xtype:'gridcolumnview', text: '序号', dataIndex: 'id',width:55},
        { xtype:'gridcolumnview', text: '标题', dataIndex: 'title',width:515},
        {text: '新闻类型', dataIndex: 'channelid',width: 105,renderer:function(value){
                if(value == 1){
                    return "<font color='green'><b>公司新闻</b></font>";
                }else if(value==2){
                    return "<font color='red'><b>行业资讯</b></font>";
                }else if(value==3){
                    return "<font color='blue'><b>通知公告</b></font>";
                }else if(value==4){
                    return "<font color='#ff4500'><b>政策法规</b></font>";
                }else if(value==5){
                    return "<font color='grey'><b>其他</b></font>";
                }
            }},
        { xtype:'gridcolumnview',text: '内容摘要', dataIndex: 'summary',width: 625},
        { text: '状态', dataIndex: 'state', width:60,renderer:function(value){
            if(value == 0){
                return "<font color='green'><b>启用</b></font>";
            }else{
                return "<font color='red'><b>禁用</b></font>";
            }
        }},
        { xtype:'gridcolumnview', text: '发布时间', dataIndex: 'create_time',width: 110},
        { xtype:'gridcolumnview', text: '发布人', dataIndex: 'creater',width: 125},
        {
            menuDisabled: true,
            sortable: false,
            xtype: 'actioncolumn',
            width: 55,
            text:'操作',
            items: [
                {
                    iconCls: 'array-grid-buy-col',
                    tooltip: '更多操作',
                    handler:'moreAction',
                    showText: '更多操作'
                }
            ]
        }
    ],
    tbar:[
        {
            xtype : 'keysearchfield'
        }
    ]

});